package org.example.demo.service;

import org.example.demo.dao.DepartmentDao;
import org.example.demo.entity.Department;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentService {
    @Autowired
    private DepartmentDao departmentDao;

    public int add(Department d){
        return departmentDao.add(d);
    }
    public int del(Integer id){
        return departmentDao.del(id);
    }

    public int updatew(Department department){
        return departmentDao.updatew(department);
    }

    public Department get(Integer id) {
        return departmentDao.get(id);
    }

    public List<Department> getAll(){
        return departmentDao.getAll();
    }
}
